package org.aiforum.service;

import java.util.Date;

import javax.transaction.Transactional;
import javax.transaction.Transactional.TxType;

import org.aiforum.common.Response;
import org.aiforum.dao.ContactDao;
import org.aiforum.domain.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Transactional(value=TxType.REQUIRED)
public class ContactServiceImpl implements ContactService{
    
	@Autowired
	private ContactDao contactDao;
	public Response save(Contact entity) {
		//设置状态和创建日期
		entity.setState(1);
		entity.setCreateDate(new Date());
		contactDao.persist(entity);
		Response response=new Response();
		response.setData(true);
		response.setMessage("Send Message");
		return response;
	}

}
